package P1000;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-08 18:22
 */
public class P1055_ISBN号码 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        scanner.close();
        char[] chars = input.toCharArray();
        int index = 1,res = 0,flag = 0;
        for(char c:chars){
            if(c == '-') {
                if(flag == 2) break;
                ++flag;
                continue;
            }
            res += index*(c-'0');
            ++index;
        }
        char code = input.charAt(input.length()-1);
        res %= 11;
        char now = res==10?'X':(char)('0'+res);
        if(now == code){
            System.out.println("Right");
        }else{
            chars[chars.length-1] = now;
            System.out.println(new String(chars));
        }
    }
}
